
#include "HelperFunctions.h"

// ============================================================================

String^ BRIDGE_ADDRESS_ToString (const BRIDGE_ADDRESS* address)
{
	return String::Format (L"{0:X2}{1:X2}{2:X2}{3:X2}{4:X2}{5:X2}",
		address->a0, address->a1, address->a2, address->a3, address->a4, address->a5);
}

// ============================================================================

String^ BRIDGE_ID_ToString (const BRIDGE_ID* id)
{
	return String::Format (L"{0:X4}.{1}",
		id->_priority.GetValue (), BRIDGE_ADDRESS_ToString (&id->_address));
}

// ============================================================================

String^ PRIORITY_VECTOR_SHORT_ToString (const PRIORITY_VECTOR_SHORT* pv)
{
	return String::Format (L"{0}--{1}--{2}--{3}--{4}--{5:X4}",
		BRIDGE_ID_ToString (&pv->RootId),
		pv->ExternalRootPathCost.GetValue ().ToString (), 
		BRIDGE_ID_ToString (&pv->RegionalRootId),
		pv->InternalRootPathCost.GetValue (),
		BRIDGE_ID_ToString (&pv->DesignatedBridgeId),
		pv->DesignatedPortId.GetValue ());
}

// ============================================================================

